package game;

import java.awt.*;

import gamestate.StateStack;
import gui.user.User;

/**
 * @author Ryan Hill
 */
public class Game
{
	/**
	 * State Stack that handles the game states
	 */
	private StateStack ss;
	/**
	 * The user that handles input
	 */
	private User user;
	
	/**
	 * Constructor
	 */
	public Game()
	{
		ss = new StateStack();
		user = new User();
		
		ss.push( new InGame( ss, user ) );
	}
	
	/**
	 * @param duration the time it took to start the frame
	 */
	public void update( double duration )
	{
		ss.update( duration );
	}
	
	/**
	 * @param g the graphics to be drawn to
	 */
	public void render( Graphics2D g )
	{
		
		ss.render( g );
	}
	
	/**
	 * @return the user ( handles input ) for the game
	 */
	public User getUser()
	{
		return user;
	}
}